<template>
  <div>
    <button @click="handleClick('你好')">打开弹框----标题是 你好</button>
    <button @click="handleClick()">打开弹框----标题是 你真菜</button>
    <Dialog v-if="isOpen" :title="title" okValue="okokok" @closeDialog="closeDialog"/>
  </div>  
</template>

<script>
import Dialog from './components/Dialog.vue'
export default {
  components: {
    Dialog,
  },
  data() {
    return {
      isOpen: false, 
      title: '今天阳光明媚， 多云转晴！！！！'
    }
  },
  methods: {
    handleClick(title) {
      this.title = title
      this.isOpen = true
    },
    closeDialog() {
      this.isOpen = false
    }
  }
}
</script>